package com.douyuehan.doubao.project.controller;

import com.douyuehan.doubao.common.api.ApiResult;
import com.douyuehan.doubao.project.model.entity.BmsPromotion;
import com.douyuehan.doubao.project.service.BmsPromotionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("promotion")
public class BmsPromotionController extends BaseController {

    @Autowired
    private BmsPromotionService bmsPromotionService;

    @GetMapping("all")
    public ApiResult<List<BmsPromotion>> getPromotion(){
        List<BmsPromotion> list = bmsPromotionService.list();
        return ApiResult.success(list);
    }
}
